﻿#include "Generation/Engine/Stage/Stage.h"

int FStage::Width()
{
	return Tiles->width();
}

int FStage::Height()
{
	return Tiles->height();
}

FRect* FStage::Bounds()
{
	return Tiles->bounds;
}

FStage::FStage(int width, int height)
{
	/// new Array2D<T>
	/// 同时会创建出它的bounds，Rect：拥有位置和大小
	/// 同时会给它里面填充默认的<T>元素
	Tiles = new FArray2D<FTile>(width, height);
}

FTile* FStage::Get(FVec* pos)
{
	return &Tiles->Get(pos);
}

FTile* FStage::Get(int x, int y)
{
	// return static_cast<FTile>(Tiles->Get(x, y));
	return &Tiles->Get(x, y);
}
